import { db } from '@/db';
import { products } from '@/db/schema';

async function seed() {
  try {
    await db.insert(products).values([
      {
        name: 'Wireless Headphones',
        price: 99.99,
        description: 'High-quality wireless headphones with noise cancellation',
        image: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400',
        stock: 25,
      },
      {
        name: 'Smart Watch',
        price: 199.99,
        description: 'Feature-rich smartwatch with health monitoring',
        image: 'https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400',
        stock: 15,
      },
      {
        name: 'Laptop Stand',
        price: 49.99,
        description: 'Adjustable laptop stand for better ergonomics',
        image: 'https://images.unsplash.com/photo-1588872657578-7efd1f1555ed?w=400',
        stock: 30,
      },
      {
        name: 'Mechanical Keyboard',
        price: 129.99,
        description: 'Premium mechanical keyboard with RGB lighting',
        image: 'https://images.unsplash.com/photo-1541140532154-b024d705b90a?w=400',
        stock: 20,
      },
      {
        name: 'Wireless Mouse',
        price: 39.99,
        description: 'Ergonomic wireless mouse with long battery life',
        image: 'https://images.unsplash.com/photo-1527864550417-7fd91fc51a46?w=400',
        stock: 40,
      },
      {
        name: 'USB-C Hub',
        price: 79.99,
        description: 'Multi-port USB-C hub with 4K HDMI output',
        image: 'https://images.unsplash.com/photo-1593642632823-8f785ba67e45?w=400',
        stock: 18,
      },
    ]);

    console.log('Database seeded successfully!');
  } catch (error) {
    console.error('Error seeding database:', error);
    process.exit(1);
  }
}

seed();